<template>
  <el-button :type="type" icon="el-icon-download" v-on:click="exportData" >{{ text }}</el-button>
</template>
  <script>
export default {
  props: {
    exporterName: {
      type: String,
      default: '',
    },
    fileName: {
      type: String,
      default: ''
    },
    type: {
      type: String,
      default: 'warning'
    },
    text: {
      type: String,
      default: '导出'
    },
    queryContent: {
      type: Object,
      default: () => {},
    }
  },
  data() {
    return {

    };
  },
  methods: {

    exportData(){
      var model = {
        fileName: this.fileName,
        queryContent: this.queryContent
      };
      return this.$service.export.load({params:{exporter: this.exporterName}, data: model});
    }
  },
};
</script>
